<%@ page language="java" contentType="text/html; charset=utf-8"  pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <!--输出,条件,迭代标签库-->
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ page isELIgnored="false" %>
<!DOCTYPE html>
<html>
<head>
    <title>程序员博客-后台管理系统-类别管理</title>
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport' />
    <!-- 引入所需css文件 -->
    <link href='assets/stylesheets/header.css' media='all' rel='stylesheet' type='text/css' />
    <%--顶部小图标--%>
    <link rel="shortcut icon " type="images/x-icon" href="assets/images/me.ico">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body class='contrast-red '>
<%--引入Jquery和自定义Js文件--%>
<script src='assets/javascripts/jquery/jquery.min.js' type='text/javascript'></script>
<script src="assets/javascripts/admin/category.js" type="text/javascript"></script>
<%--测试是否登录--%>
<script src="assets/javascripts/admin/testlogin.js" type="text/javascript"></script>
<%--顶部开始--%>
<%@include file="topbar.jsp" %>
<%--顶部结束--%>
<div id='wrapper'>
<div id='main-nav-bg'></div>
<nav class='' id='main-nav'>
<div class='navigation'>
<div class='search'>
    <form accept-charset="UTF-8" action="template/search_results.html" method="get" /><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /></div>
        <div class='search-wrapper'>
            <input autocomplete="off" class="search-query" id="q" name="q" placeholder="Search..." type="text" value="" />
            <button class="btn btn-link icon-search" name="button" type="submit"></button>
        </div>
    </form>
</div>
    <%--左侧边栏开始--%>
    <%@include file="sidebar.jsp" %>
    <%--左侧边栏结束--%>
</div>
</nav>
<section id='content'>
<div class='container-fluid'>
<div class='row-fluid' id='content-wrapper'>
<div class='span12'>
<div class='row-fluid'>
    <div class='span12'>
        <div class='page-header'>
            <h1 class='pull-left'>
                <i class='icon-table'></i>
                <span>分类列表</span>
            </h1>
            <div class='pull-right'>
                <ul class='breadcrumb'>
                    <li>
                        <a href="/admin/index"><i class='icon-bar-chart'></i>
                        </a>
                    </li>
                    <li class='separator'>
                        <i class='icon-angle-right'></i>
                    </li>
                    <li class='active'>分类列表</li>
                </ul>
            </div>
        </div>
    </div>
</div>
<div class='row-fluid'>
<div class='span12 box bordered-box orange-border' style='margin-bottom:0;'>
<div class='box-content box-no-padding'>
<div class='responsive-table'>
<div class='scrollable-area'>
<table class='data-table table table-bordered table-striped' style='margin-bottom:0;'>
<thead>
<tr>
    <th>
        分类名称
    </th>
    <th>
        父类名称
    </th>
    <th>
        创建时间
    </th>
    <th>
        最近更改时间
    </th>
    <th>
        状态
    </th>
    <th>操作</th>
</tr>
</thead>
<tbody>
<c:forEach items="${blogCategoryList}" var="blogCategory" >
    <tr>
        <%--<a class="hidden parentId${blogCategory.id}">${blogCategory.id}</a>--%>
        <td class="categoryName${blogCategory.id}">${blogCategory.categoryName}</td>
        <td class="parentcategoryName${blogCategory.id}">
            <c:if test="${blogCategory.parentCategoryName!=null}">${blogCategory.parentCategoryName}</c:if>
            <c:if test="${blogCategory.parentCategoryName==null}">没有父类</c:if>
        </td>
        <td><fmt:formatDate value="${blogCategory.createtime}" pattern="yyyy年MM月dd日HH点mm分ss秒"/></td>
        <td><fmt:formatDate value="${blogCategory.lastEdittime}" pattern="yyyy年MM月dd日HH点mm分ss秒"/></td>
        <c:if test="${blogCategory.status==1}"><td class="status${blogCategory.id}"><i class="icon-ok" title="正常"></i></td></c:if>
        <c:if test="${blogCategory.status==-1}"><td class="status${blogCategory.id}"><i class="icon-remove" title="封禁"></i></td></c:if>
        <td>
            <div class='text-right'>
            <span title="编辑" class='btn btn-success btn-mini edit edit${blogCategory.id}' value="${blogCategory.id}">
                <i class='icon-edit'></i>
            </span>
                <a title="删除" class='btn btn-danger btn-mini' value='${blogCategory.id}'>
                    <i class='icon-remove' ></i>
                </a>
            </div>
        </td>
    </tr>
</c:forEach>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
    <%--<style>--%>
        <%--.categorylist td:hover{--%>
            <%--background-color: red;--%>
        <%--}--%>
    <%--</style>--%>
</section>
    <%--登录提示模态框开始--%>
    <a  class="hidden fail" data-toggle="modal" data-target="#mustlogin">
    </a>
    <div class="modal fade" id="mustlogin" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="myModalLabe2">
                        很遗憾
                    </h4>
                </div>
                <div class="modal-body fail-message">
                    请先登录
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                    </button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>
    <%--登录提示模态框结束--%>
    <%--修改分类模态框开始--%>
    <a  class="update_category" data-toggle="modal" data-target="#update_category"></a>
    <div class="modal fade" id="update_category" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop=”static”>
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="">
                        <i class="icon-edit"></i>修改分类
                    </h4>
                </div>
                <div class="modal-body fail-message">
                    <%--修改分类表单开始--%>
                    <div class="">
                            <div class="mws-panel grid_8">
                                <div class="mws-panel-body no-padding">
                                        <div class="mws-form-inline">
                                            <div class="mws-form-row">
                                                <button class="hidden" id="new_categoryid"></button>
                                                <label class="mws-form-label">分类名</label>
                                                <div class="mws-form-item">
                                                    <input type="text" placeholder="请输入新分类名" class="small" id="new_category_name">
                                                    <%--<span class="name_error_tip"></span>--%>
                                                </div>
                                            </div>
                                            <div class="mws-form-row">
                                                <label class="mws-form-label">父类名称</label>
                                                <div class="mws-form-item">
                                                    <select id="new_parent_category_name">
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="mws-form-row">
                                                <label class="mws-form-label">状态</label>
                                                <div class="mws-form-item">
                                                    <select id="new_status">
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="mws-button-row">
                                            <button id="submit" class="btn btn-danger">修改</button>
                                        </div>
                                </div>
                            </div>
                    </div>
                    <%--修改分类表单结束--%>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                    </button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>
    <%--修改分类模态框结束--%>
</div>
<%--引入js文件--%>
<%@include file="include_js.jsp" %>
</body>
</html>
